<?php

namespace app\admin\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule = [
        'title'  =>  'require|min:10|max:50',
        'content' =>  'require',
        'category_id' => 'require|integer',
        'user_id' => 'require',
        'score' => 'egt:1',
        'status' => 'in:0,1,2',
        'type' => 'in:0,1,2,3|require'
    ];
    protected $message = [
      'title.require' => '标题不能为空',
      'title.min' => '标题最少字数为10',
      'title.max' => '标题最大字数为50',
      'type.require' => '文章类型不能为空',
      'content.require' => '文章内容不能为空',
      'category_id.require' => '文章分类Id不能为空',
      'user_id.require' => '发布者ID不能为空',
      'score.egt' => '积分需大于0',
    ];
    protected $scene  = [
     
    ];
    
}